import { getFormatterPrice } from '@const/filter'

// 表单字段
export const adddata = [
  {
    key: 'sickName',
    title: '患者姓名',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 30,
      placeholder: '请输入'
    }
  },
  {
    key: 'bedNum',
    title: '床号',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'admissionNumber',
    title: '住院号',
    type: 'input',
    attr: {
      // maxlength: 100,
      placeholder: '请输入'
    }
  },
  {
    key: 'sickSex',
    title: '性别',
    type: 'select',
    attr: {
      placeholder: '请选择'
    },
    options: [{
      value: 0,
      label: '男'
    }, {
      value: 1,
      label: '女'
    }]
  },
  {
    key: 'sickAge',
    title: '年龄',
    type: 'input',
    attr: {
      // maxlength: 100,
      placeholder: '请输入'
    }
  },
  {
    key: 'operationDate',
    title: '手术时间',
    type: 'time',
    attr: {
      class: 'date',
      type: 'datetime',
      placeholder: '请选择',
      defaultTime: '11:00:00'
    }
  },
  {
    key: 'operationDoctor',
    title: '手术医生',
    type: 'input',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'operationType',
    title: '手术类型',
    type: 'select',
    attr: {
      placeholder: '请选择'
    },
    options: [{
      value: '脊柱',
      label: '脊柱'
    }, {
      value: '创伤',
      label: '创伤'
    }, {
      value: '其他',
      label: '其他'
    }
    ]
  },
  {
    key: 'operationRoom',
    title: '手术室',
    type: 'input',
    attr: {
      // maxlength: 100,
      placeholder: '请输入'
    }
  },
  {
    key: 'createEnterprise',
    title: '生产企业',
    type: 'input',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'makeInvoice',
    title: '开票日期',
    type: 'time',
    attr: {
      class: 'date',
      type: 'date',
      placeholder: '请选择'
    }
  },
  {
    key: 'afterServer',
    title: '售后服务机构',
    type: 'input',
    attr: {
      // maxlength: 40,
      placeholder: '请输入'
    }
  },
  {
    key: 'invoiceNum',
    title: '发票号',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'address',
    title: '地址',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 60,
      placeholder: '请输入'
    }
  },
  {
    key: 'connectPhone',
    title: '联系方式',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 60,
      placeholder: '请输入'
    }
  },

  {
    key: 'applianceWorker',
    title: '器械师',
    type: 'input',
    value: '',
    attr: {
      // maxlength: 200,
      placeholder: '请输入'
    }
  }
]

// 表单验证
export const associationrules = {
  sickName: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  bedNum: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  admissionNumber: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  sickSex: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  sickAge: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationDate: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationDoctor: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationType: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  operationRoom: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  creatEnterprise: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  afterServe: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  address: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  connectPhone: [
    { required: true, message: '请输入', trigger: 'change' }
  ],
  applianceWorker: [
    { required: true, message: '请输入', trigger: 'change' }
  ]
}
// 退回产品表头
export const postoperativeProduct = [
  {
    type: 'selection',
    fixed: 'left'
  }, {
    width: '40',
    prop: 'placeholder',
    fixed: 'left',
    type: 'expand'
  }, {
    prop: 'deliveryProductCode',
    label: '配送商产品编码',
    minWidth: 200
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 200
  }, {
    prop: 'productType',
    label: '规格 型号',
    width: 150,
    formatter: row => `${row.specification || row.productType ? `${row.specification} ${row.productType}` : ''}`
  }, {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 150
  }, {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 170
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 80,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'unit',
    label: '计量单位',
    width: 90
  },
  {
    prop: 'purchaseNum',
    label: '采购数量',
    width: 90
  },
  {
    prop: 'storageCondition',
    label: '存储条件',
    minWidth: 120
  },
  {
    prop: 'provinceProductCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }
]
// 退回弹框产品表头
export const handlelistColumns = [
  {
    prop: 'deliveryProductCode',
    label: '配送商产品编码',
    minWidth: 200
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 200
  }, {
    prop: 'productType',
    label: '规格 型号',
    width: 150,
    formatter: row => `${row.specification || row.productType ? `${row.specification} ${row.productType}` : ''}`
  }, {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 150
  }, {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 170
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 90,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'unit',
    label: '计量单位',
    width: 90
  },
  {
    prop: 'purchaseNum',
    label: '采购数量',
    width: 90
  },
  {
    prop: 'storageCondition',
    label: '存储条件',
    minWidth: 120
  },
  {
    prop: 'provinceProductCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }
]
// 退回产品数量表头
export const handleitemColumns = [
  { minWidth: '180', prop: 'udi', label: 'UDI' },
  { minWidth: '180', prop: 'barCode', label: '主条码' },
  { minWidth: '180', prop: 'erialNumber', label: '序列号' },
  { minWidth: '180', prop: 'productBatch', label: '批号' },
  { minWidth: '180', prop: 'productDate', label: '生产日期' },
  { minWidth: '180', prop: 'expDate', label: '有效期' },
  { minWidth: '150', prop: 'num', label: '退货数量' },
  { minWidth: '100', prop: 'action', label: '操作' }
]

// tab状态
export const OPERATION_ORDER_STATUS = [
  {
    label: '待发货',
    value: 'voucherStatusNotDelivery'
  },
  {
    label: '待术后还回',
    value: 'voucherStatusReturn'
  },
  {
    label: '已完成',
    value: ''
  }
]
// 列表页-tab
export const indexTabsArr = [
  { lab: '待客户审核', val: 8, badge: { value: null } },
  { lab: '待响应', val: 1, badge: { value: null } },
  { lab: '待发货', val: 2, badge: { value: null } },
  { lab: '待术后还回', val: 3, badge: { value: null } },
  { lab: '已完成', val: 4, badge: { value: null } },
  { lab: '已驳回', val: 9, badge: { value: null } },
  { lab: '已撤销', val: 5, badge: { value: null } },
  { lab: '已拒绝', val: 6, badge: { value: null } },
  { lab: '全部', val: 0, badge: { value: null } }
]
// 订单状态
// wangjiaqi 11.25 适应性修改
export const ORDER_STATUS = {
  // 0: '全部',
  // 1: '待确认',
  // 2: '待发货',
  // 3: '部分发货',
  // 4: '已完成',
  // 4: '全部发货',
  // 5: '已完成',
  // 6: '已撤销',
  1: '待响应',
  2: '待发货',
  3: '待术后还回',
  4: '已完成',
  5: '已撤销',
  6: '已拒绝',
  8: '待审核',
  9: '已驳回'

}

// 产品大类
export const PRODUCT_CATEGORY = {
  1: '高值',
  2: '低值',
  3: '试剂',
  4: '设备',
  5: '低值'
}
// 管理分类
export const PRODUCT_MANAGE_CATEGORY = {
  1: '一类',
  2: '二类',
  3: '三类'
}
// 注册地
export const PRODUCT_REGISTER_TYPE = {
  1: '国产',
  2: '港澳台',
  3: '进口'
}

// 查询项
export const SEARCH_FORM = [
  {
    key: 'pssOrderCode',
    title: '销售单号',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'hospitalOrderCode',
    title: '关联订单号',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'applyDept',
    title: '申请科室',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'hospitalName',
    title: '医疗机构',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'time',
    title: '创建时间',
    type: 'time',
    fieldname: ['beginDate', 'endDate'],
    attr: {
      placeholder: '请选择',
      type: 'daterange',
      'start-placeholder': '开始时间',
      'end-placeholder': '结束时间',
      'default-time': ['00:00:00', '23:59:59']
    }
  }
]
// 手术跟台需求订单列表表头
export const ORDER_COLUMNS = [
  {
    minWidth: '150',
    prop: 'pssOrderCode',
    label: '销售单号'
  },
  {
    minWidth: '150',
    prop: 'hospitalOrderCode',
    label: '关联订单号'
  },
  {
    prop: 'applyDept',
    width: '130',
    label: '申请科室'
  },
  {
    prop: 'operationName',
    minWidth: '150',
    label: '拟手术名称',
    'show-overflow-tooltip': true
  },
  {
    prop: 'sickName',
    minWidth: '100',
    label: '病人姓名'
  },
  {
    prop: 'prodTypeCount',
    width: '100',
    label: '品种数',
    'show-overflow-tooltip': true
  },
  {
    prop: 'prodCount',
    width: '100',
    label: '产品数量'
  },
  {
    prop: 'orderTotalAmount',
    width: '150',
    label: '订单金额（元）',
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.orderTotalAmount || 0)
  },
  {
    prop: 'receiveAddress',
    minWidth: '200',
    label: '收货地址',
    'show-overflow-tooltip': true
  },
  {
    prop: 'concatMan',
    width: '100',
    label: '联系人',
    'show-overflow-tooltip': true
  },
  {
    prop: 'concatPhone',
    width: '100',
    label: '联系电话',
    'show-overflow-tooltip': true
  },
  {
    prop: 'hospitalName',
    minWidth: '150',
    label: '医疗机构',
    'show-overflow-tooltip': true
  },
  {
    prop: 'createdAt', // 1
    width: '160',
    label: '创建时间'
  },
  {
    prop: 'orderStatus',
    width: '100',
    label: '订单状态',
    formatter: row => ORDER_STATUS[row.orderStatus] },
  {
    width: '150',
    prop: 'action',
    label: '操作',
    fixed: 'right'
  }
]
export const sexMap = {
  0: '男',
  1: '女',
  '--': '男'
}
// 术后退回top信息
export const TOP_INFO = [
  {
    label: '平台订单编号',
    value: 'platOrderCode'
  },
  {
    label: '订单状态',
    value: 'orderStatus'
  },
  {
    label: '订单提交时间',
    value: 'orderCreatedAt'
  },
  {
    label: '医疗机构',
    value: 'hospitalName'
  }
]
// 术后退回form表单
export const OPERATION_FORM = [
  {
    $type: 'input',
    $id: 'sickName',
    label: '患者姓名',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'bedNumber',
    label: '床号',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'operationNumber',
    label: '住院号',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'select',
    $id: 'sex',
    label: '性别',
    $el: {
      placeholder: '请选择'
    },
    $options: [{
      label: '男',
      value: 1
    },
    {
      label: '女',
      value: 2
    }
    ],
    rules: [{
      required: true,
      message: '请选择',
      trigger: 'change'
    }]
  },
  {
    $type: 'input',
    $id: 'sickAge',
    label: '年龄',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'date-picker',
    $id: 'operationDate',
    label: '手术时间',
    $el: {
      type: 'datetime',
      placeholder: '选择日期',
      prefixIcon: 'el-icon-date'
    },
    rules: [{
      type: 'date',
      required: true,
      message: '请选择时间',
      trigger: 'change'
    }]
  },
  {
    $type: 'input',
    $id: 'operationDoctor',
    label: '手术医生',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'select',
    $id: 'operateType',
    label: '手术类型',
    $el: {
      placeholder: '请选择'
    },
    $options: [{
      label: '脊柱 ',
      value: 'hospital1'
    },
    {
      label: '创伤',
      value: 'hospital2'
    }
    ],
    rules: [{
      required: true,
      message: '请选择',
      trigger: 'change'
    }]
  },
  {
    $type: 'input',
    $id: 'operationRoom',
    label: '手术室',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'productCompany',
    label: '生产企业',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'date-picker',
    $id: 'invoiceDate',
    label: '开票日期',
    $el: {
      type: 'datetime',
      placeholder: '选择日期',
      prefixIcon: 'el-icon-date'
    }
  },
  {
    $type: 'input',
    $id: 'afterSaleService',
    label: '售后服务机构',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'invoiceNum',
    label: '发票号',
    $el: {
      placeholder: '请输入'
    }
  },
  {
    $type: 'input',
    $id: 'address',
    label: '地址',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'linkWay',
    label: '联系方式',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'instrumentDivision',
    label: '器械师',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  },
  {
    $type: 'input',
    $id: 'totalMoney',
    label: '总价',
    $el: {
      placeholder: '请输入'
    },
    rules: [{
      required: true,
      message: '请输入',
      trigger: 'blur'
    }]
  }
]
// 条码tab
export const TAB_ARR = [
  {
    lab: '短码',
    val: 1
  },
  {
    lab: '长码',
    val: 2
  }
]
// 术后退回列表表头
export const TABLE_COLUMNS = [{
  prop: 'productCode',
  label: '配送商产品编码',
  width: 200
},
{
  prop: 'productName',
  label: '配送商产品名称',
  width: 200
},
{
  prop: 'productSpec',
  label: '规格  型号',
  width: 150,
  formatter: row => `${row.productSpec || row.productType ? `${row.productSpec} ${row.productType}` : ''}`
},
{
  prop: 'factory',
  label: '生产厂家',
  minWidth: 150
},
{
  prop: 'certificateNo',
  label: '注册证号/备案证号',
  width: 250
},
{
  prop: 'unitPrice',
  label: '单价(元)',
  width: 150,
  formatter: row => getFormatterPrice(row.price || 0)
},
{
  prop: 'udi',
  label: 'UDI',
  width: 150
}, {
  prop: 'mainUdi',
  label: '主条码',
  width: 150
},
{
  prop: 'erialNumber',
  label: '序列号',
  width: 150
},
{
  prop: 'batchNum',
  label: '批号',
  width: 150
}, {
  prop: 'producedDate',
  label: '生产日期',
  minWidth: 200
}, {
  prop: 'periodDate',
  label: '有效日期',
  minWidth: 200
},
{
  prop: 'returnNum',
  label: '发货数量',
  width: 150
},
{
  prop: 'minUnit',
  label: '计量单位',
  width: 150
},
{
  prop: 'entryNumf',
  label: '储存条件',
  width: 150
},
{
  prop: 'entryNumf',
  label: '省平台产品编码',
  width: 150
},
{
  prop: 'entryNfumf',
  label: 'M平台产品编码',
  width: 150
}, {
  prop: 'action',
  label: '操作',
  width: 150
}
]
// 发货
export const DELIVER_TOP_INFO = [{
  label: '平台订单编号',
  value: 'orderCode'
},
{
  label: '订单状态',
  value: 'orderStatus'
},
{
  label: '订单提交时间',
  value: 'createdAt'
},
{
  label: '医疗机构',
  value: 'hospitalName'
},
{
  label: '手术名称',
  value: 'operationName'
},
{
  label: '手术医生',
  value: 'operationDoctor'
},
{
  label: '手术时间',
  value: 'operationDate'
},
{
  label: '手术类型',
  value: 'operationType'
},
{
  label: '手术室',
  value: 'operationRoom'
},
{
  label: '台号',
  value: 'operationNum'
},
{
  label: '备注',
  value: 'desc'
}
]
// 详情
export const DETAIL_TOP_INFO = [{
  label: '平台订单编号',
  value: 'orderCode'
},
{
  label: '订单状态',
  value: 'orderStatus'
},
{
  label: '订单提交时间',
  value: 'createdAt'
},
{
  label: '医疗机构',
  value: 'hospitalName'
},
{
  label: '患者姓名',
  value: 'sickName'
},
{
  label: '床号',
  value: 'bedNum'
},
{
  label: '住院号',
  value: 'admissionNumber'
},
{
  label: '性别',
  value: 'sickSex'
},
{
  label: '年龄',
  value: 'sickAge'
},
{
  label: '手术时间',
  value: 'operationDate'
},
{
  label: '生产企业',
  value: 'desc'
},
{
  label: '手术医生',
  value: 'operationDoctor'
},
{
  label: '手术类型',
  value: 'desc'
},
{
  label: '售后服务机构',
  value: 'desc'
},
{
  label: '开票日期',
  value: 'desc'
},
{
  label: '发票号',
  value: 'desc'
},
{
  label: '地址',
  value: 'desc'
},
{
  label: '联系方式',
  value: 'desc'
},
{
  label: '器械师',
  value: 'desc'
}
]
// 详情列表表头
export const DETAIL_TABLE_COLUMNS = [
  {
    width: '40',
    prop: 'placeholder',
    fixed: 'left',
    type: 'expand'
  },
  {
    prop: 'cargo',
    label: '配送明细编号',
    minWidth: 150
  }, {
    prop: 'deliveryProductcCode',
    label: '配送商产品编码',
    minWidth: 150
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 150
  }, {
    prop: 'specification',
    label: '规格型号',
    minWidth: 150
  }, {
    prop: 'category',
    label: '产品大类',
    width: 100
  }, {
    prop: 'batchNumber',
    label: '批号',
    width: 150
  }, {
    prop: 'periodDate',
    label: '有效日期',
    width: 170
  }, {
    prop: 'purchaseNum',
    label: '配送单数量',
    minWidth: 160
  }, {
    prop: 'unit',
    label: '计量单位',
    width: 100
  }, {
    prop: 'storageCondition',
    label: '储存条件',
    width: 100
  }, {
    prop: 'productProductcCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }
]
// 详情列表里面得列表表头
export const DEATIL_INDISE_COLUMNS = [
  {
    label: '序号',
    type: 'index',
    width: 80
  }, {
    prop: 'udi',
    label: 'UDI',
    minWidth: 150
  }, {
    prop: 'barCode',
    label: '主条码',
    minWidth: 150
  }, {
    prop: 'productBatch',
    label: '批号',
    minWidth: 150
  }, {
    prop: 'productDate',
    label: '生产日期',
    width: 170
  }, {
    prop: 'expDate',
    label: '有效期',
    width: 170
  }, {
    prop: 'erialNumber',
    label: '序列号',
    minWidth: 150
  }, {
    prop: 'num',
    label: '数量',
    width: 170
  }, {
    prop: 'entryNumd',
    label: '条码图片',
    width: 150
  }
]

// 发货table列表表头
export const DELIVER_GOODS_COLUMNS = [
  {
    width: '40',
    prop: 'placeholder',
    fixed: 'left',
    type: 'expand'
  }, {
    prop: 'deliveryProductCode',
    label: '配送商产品编码',
    minWidth: 200
  }, {
    prop: 'deliveryProductName',
    label: '配送商产品名称',
    minWidth: 200
  }, {
    prop: 'productType',
    label: '规格 型号',
    width: 150,
    formatter: row => `${row.specification || row.productType ? `${row.specification} ${row.productType}` : ''}`
  }, {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 100
  }, {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 170
  }, {
    prop: 'category',
    label: '产品大类',
    width: 100,
    formatter: row => PRODUCT_CATEGORY[row.category]

  }, {
    prop: 'purchaseNum',
    label: '订单总数量',
    width: 100
  }, {
    prop: 'sendNum',
    label: '已发货数量',
    width: 100
  }, {
    prop: 'sweepCount',
    label: '已扫码/待发货数量',
    width: 150,
    formatter: row => `${row.awaitSendNum ? `${row.sweepCount}/${row.awaitSendNum}` : row.sweepCount}`
  }, {
    prop: 'storageCondition',
    label: '存储条件',
    minWidth: 100
  }, {
    prop: 'provinceProductCode',
    label: '省平台产品编码',
    width: 150
  }, {
    prop: 'itemCode',
    label: 'M平台产品编码',
    width: 150
  }, {
    prop: 'action',
    label: '操作',
    width: 100,
    fixed: 'right'
  }
]

// 部分详情列表中的列表
export const PART_DETAIL_COLUMNS_INSIDE = [
  {
    label: '序号',
    type: 'index',
    width: 80
  }, {
    prop: 'udi',
    label: 'UDI',
    width: 150
  }, {
    prop: 'barCode',
    label: '主条码',
    width: 150
  }, {
    prop: 'productBatch',
    label: '批号',
    width: 150
  }, {
    prop: 'productDate',
    label: '生产日期',
    width: 150
  }, {
    prop: 'expDate',
    label: '有效期',
    width: 150
  }, {
    prop: 'erialNumber',
    label: '序列号',
    width: 150
  }, {
    prop: 'num',
    label: '数量',
    width: 170
  }, {
    prop: 'entryNumd',
    label: '条码图片',
    width: 150
  }
]
//  ---------------------------------手术跟台（1.5.0）新版详情页面----------------------------------------------------
// 展开组件的子列表表头(待确认,已取消,待收货,已拒绝)
export const cardSonConfirmedColumns = [
  { type: 'index', label: '序号', width: 80 },
  { prop: 'barCode', label: '主条码', width: 150 },
  { prop: 'productDate', label: '生产日期', width: 150 },
  { prop: 'expDate', label: '有效期', width: 150 },
  { prop: 'productBatch', label: '批号', width: 150 },
  { prop: 'serialNumber', label: '序列号', width: 150 },
  { prop: 'udi', label: 'UDI', 'min-width': 150 },
  { prop: 'num', label: '数量', width: 150 }
]
// 1-待确认，3-部分收货，4-已完成，6-已取消， 5待术后还回 ,8-待质检，9-待收货 ',
export const statusArr = {
  1: '待确认',
  2: '待发货',
  3: '待术后还回',
  4: '已完成',
  5: '',
  6: '已取消',
  8: '待质检',
  9: '待收货'
}
// (部分收货详情)
export const headerPartialCollectionColumns = [
  [{
    label: '销售单号',
    key: 'pssOrderCode'
  },
  {
    label: '关联订单号',
    key: 'hospitalOrderCode'
  },
  {
    label: '订单状态',
    key: 'orderStatus'
  }],
  [{
    label: '创建时间',
    key: 'createdAt'
  },
  {
    label: '医疗机构',
    key: 'hospitalName'
  },
  {
    label: '供应商',
    key: 'upCompanyName'
  }],
  [{
    label: '申请科室',
    key: 'applyDept'
  },
  {
    label: '收货地址',
    key: 'receiveAddress'
  },
  {
    label: '联系人',
    key: 'concatMan'
  }],
  [{
    label: '联系电话',
    key: 'concatPhone'
  }]
]
export const returnOperationOrderColumns = [
  [{
    label: '术后还回单号',
    key: 'purchaseOrderCode'
  },
  {
    label: '关联订单号',
    key: 'hospitalOrderCode'
  },
  {
    label: '订单状态',
    key: 'purchaseOrderStatus'
  }],
  [{
    label: '创建时间',
    key: 'createdAt'
  },
  {
    label: '配送商',
    key: 'createdAt'
  },
  {
    label: '供应商',
    key: 'a'
  }],
  [{
    label: '申请科室',
    key: 'supplierName'
  },
  {
    label: '收货地址',
    key: 'receiveAddress'
  },
  {
    label: '联系人',
    key: 'linkMan'
  }], [{
    label: '联系电话',
    key: 'linkPhone'
  }]
]
export const patientInfoColumns = [
  [{
    label: '住院号',
    key: 'admissionNumber'
  },
  {
    label: '姓名',
    key: 'sickName'
  },
  {
    label: '性别',
    key: 'sickSex'
  }],
  [{
    label: '年龄',
    key: 'sickAge'
  },
  {
    label: '科室',
    key: 'hspDept'
  },
  {
    label: '手术医生',
    key: 'operationDoctor'
  }],
  [{
    label: '手术时间',
    key: 'operationDate'
  },
  {
    label: '拟手术名称',
    key: 'operationName'
  },
  {
    label: '备注',
    key: 'remark'
  }]
]
export const returnPatientInfoColumns = [
  [{
    label: '住院号',
    key: 'linkPhone'
  },
  {
    label: '姓名',
    key: 'linkPhone'
  },
  {
    label: '性别',
    key: 'linkPhone'
  }],
  [{
    label: '年龄',
    key: 'linkPhone'
  },
  {
    label: '科室',
    key: 'linkPhone'
  },
  {
    label: '手术医生',
    key: 'linkPhone'
  }],
  [{
    label: '手术时间',
    key: 'linkPhone'
  },
  {
    label: '手术名称',
    key: 'linkPhone'
  },
  {
    label: '备注',
    key: 'beizhu'
  }, {
    label: '附件',
    key: 'fujian',
    show: true
  }]
]
export const consumeOperationOrderColumns = [
  [{
    label: '手术消耗单号',
    key: 'purchaseOrderCode'
  },
  {
    label: '关联订单号',
    key: 'hospitalOrderCode'
  },
  {
    label: '订单状态',
    key: 'purchaseOrderStatus'
  }],
  [{
    label: '创建时间',
    key: 'createdAt'
  },
  {
    label: '配送商',
    key: 'createdAt'
  },
  {
    label: '供应商',
    key: 'a'
  }
  ],
  [ {
    label: '申请科室',
    key: 'supplierName'
  },
  {
    label: '收货地址',
    key: 'receiveAddress'
  },
  {
    label: '联系人',
    key: 'linkMan'
  }],
  [{
    label: '联系电话',
    key: 'linkPhone'
  }]

]
export const returnOperationColumns = [
  { type: 'index', label: '序号', width: 56 },
  {
    prop: 'returnItemCode',
    label: '收货明细单号',
    width: 170,
    'show-overflow-tooltip': true
  },
  {
    prop: 'relationItemCode',
    label: '关联明细单号',
    width: 170,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'minUnit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 100,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'purchaseNum',
    label: '销售数量',
    width: 120
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount || 0)
  },
  {
    prop: 'hspProdCode',
    label: '医疗机构产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  // {
  //   prop: 'awaitReceiveNum', // 暂时没有
  //   label: '已收货数量',
  //   width: 120
  // },
  { prop: 'returnNum', label: '术后还回收货数量', width: 150 }
]
export const consumeOperationColumns = [
  { type: 'index', label: '序号', width: 56 },
  {
    prop: 'consumeItemCode',
    label: '消耗明细单号',
    width: 170,
    'show-overflow-tooltip': true
  },
  {
    prop: 'relationItemCode',
    label: '关联明细单号',
    width: 170,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'minUnit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'purchaseNum',
    label: '销售数量',
    width: 120
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount || 0)
  },
  {
    prop: 'hspProdCode',
    label: '医疗机构产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  { prop: 'consumeNum', label: '消耗数量', width: 150 }
]
// 详情列表 (部分收货)
export const detailPartialCollectionColumns = [
  { type: 'index', label: '序号', width: 56 },
  {
    prop: 'pssOrderItemCode',
    label: '销售明细单号',
    width: 170,
    'show-overflow-tooltip': true
  },
  {
    prop: 'relationItemCode',
    label: '关联明细单号',
    width: 170,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    'min-width': 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'minUnit',
    label: '最小单位',
    width: 100
  },
  { prop: 'price', label: '销售价格（元）', width: 130 },
  { prop: 'templatePrice', label: '模板价格（元）', width: 130 },
  { prop: 'priceDifference', label: '价格差异（元）', width: 130 },
  // {
  //   prop: 'price',
  //   label: '单价(元)',
  //   width: 120,
  //   'show-overflow-tooltip': true,
  //   formatter: row => getFormatterPrice(row.price || 0)
  // },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 170,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 100,
    'show-overflow-tooltip': true,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'purchaseNum',
    label: '销售数量',
    width: 120
  },
  {
    prop: 'detailAmount',
    label: '小计金额（元）',
    width: 150,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount || 0)
  },
  {
    prop: 'hspProdCode',
    label: '医疗机构产品编码',
    width: 150,
    'show-overflow-tooltip': true
  }
]
export const RecivePartialCollectionColumns = [
  { type: 'index', label: '序号', width: 56 },
  {
    prop: 'orderItemCode',
    label: '发货明细单号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'pssOrderItemCode',
    label: '关联明细单号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'itemCode',
    label: '产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'minUnit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'price',
    label: '单价(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.price || 0)
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    width: 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 100,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'purchaseNum',
    label: '销售数量',
    width: 80
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(row.detailAmount || 0)
  },
  {
    prop: 'hspProdCode',
    label: '医疗机构产品编码',
    width: 150,
    'show-overflow-tooltip': true
  },
  {
    prop: 'sendNum',
    label: '发货数量',
    width: 150
  }
]
export const cardPartialCollectionColumns = [
  // { width: '40', prop: 'placeholder', fixed: 'left', type: 'expand' },
  // { prop: 'receiveItemCode', label: '发货明细单号', width: 150 },
  // { prop: 'receiveItemCode', label: '关联明细单号', width: 150 }, // 1
  { prop: 'itemCode', label: '产品编码', width: 150 }, // 1
  { prop: 'nameCn', label: '产品名称', 'min-width': 150 }, // 1
  { prop: 'specification', label: '规格', width: 150 },
  { prop: 'productType', label: '型号', width: 150 },
  { prop: 'minUnit', label: '最小单位', width: 150 },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => `${row.price && row.minUnit ? `${getFormatterPrice(row.price)}/${row.minUnit}` : row.price || row.minUnit ? getFormatterPrice(row.price || 0) : ''}`
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 180 },
  { prop: 'manufacturer', label: '生产厂家', 'min-width': 100, 'show-overflow-tooltip': true },
  { prop: 'category', label: '产品大类', width: 150, formatter: row => PRODUCT_CATEGORY[row.category] },
  { prop: 'sendNum', label: '销售数量', width: 150 }, // 1
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount || 0)
  },
  { prop: 'hspProdCode', label: '医疗机构产品编码', width: 150 },
  { prop: 'sendNum', label: '发货数量', width: 150 } // 1
  // { prop: 'itemCode', label: '产品编码', 'min-width': 150 }, // 1

  // { prop: 'batch', label: '批号', width: 170 },

  // { prop: 'minUnit', label: '计量单位', width: 150 },
  // { prop: 'itemCheckNum', label: '质检异常数', width: 150 },

  // { prop: 'storageCondition', label: '存储条件', width: 150 },
  // { prop: 'provinceProductCode', label: '省平台产品编码', width: 150 },

]
export const detailTabList = [
  {
    lab: '订单信息',
    value: 0,
    disabled: null
  },
  {
    lab: '发货信息',
    value: 1,
    disabled: null
  },
  {
    lab: '术后还回信息',
    value: 2,
    disabled: null
  },
  {
    lab: '预消耗信息',
    value: 3,
    disabled: null
  }
]
export const dialogListColumns = [
  { prop: 'itemCode', label: '产品编码', width: 150 }, // 1
  { prop: 'nameCn', label: '产品名称', 'min-width': 150 }, // 1
  { prop: 'specification', label: '规格', width: 150 },
  { prop: 'productType', label: '型号', width: 150 },
  { prop: 'minUnit', label: '最小单位', width: 150 },
  {
    prop: 'price',
    label: '单价(元)',
    width: 150,
    formatter: row => `${row.price && row.minUnit ? `${getFormatterPrice(row.price)}/${row.minUnit}` : row.price || row.minUnit ? getFormatterPrice(row.price || 0) : ''}`
  },
  { prop: 'registrationNumber', label: '注册证号/备案证号', width: 180 },
  { prop: 'manufacturer', label: '生产厂家', 'min-width': 100, 'show-overflow-tooltip': true },
  { prop: 'category', label: '产品大类', width: 150, formatter: row => PRODUCT_CATEGORY[row.category] },
  { prop: 'sendNum', label: '采购数量', width: 150 }, // 1
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 150,
    formatter: row => getFormatterPrice(row.detailAmount || 0)
  },
  { prop: 'hspProdCode', label: '医疗机构产品编码', width: 150 }
]
export const dialogColumns = [
  { type: 'selection', width: '50' },
  { minWidth: '150', prop: 'code', label: '产品编码' },
  { minWidth: '150', prop: 'prodName', label: '产品名称', 'show-overflow-tooltip': true },
  { minWidth: '150', prop: 'spec', label: '规格', 'show-overflow-tooltip': true },
  { minWidth: '150', prop: 'model', label: '型号', 'show-overflow-tooltip': true },
  { width: '80', prop: 'unit', label: '最小单位' },
  { width: '150', prop: 'modelPrice', label: '单价 （元）', formatter: row => getFormatterPrice(row.modelPrice || 0) },
  { minWidth: '180', prop: 'registNo', label: '注册证号/备案证号' },
  { minWidth: '150', prop: 'manufacturer', label: '生产厂家' },
  { width: '150',
    prop: 'bigType',
    label: '产品大类',
    formatter: row => PRODUCT_CATEGORY[row.bigType] },
  { width: '150', prop: 'upEnterpriseName', label: '供应商' },
  { width: '150', prop: 'hosProdCode', label: '医疗机构产品编码' } // 1
]
export const responseAddColumns = [
  { type: 'selection', width: '50' },
  // { type: 'index', width: '50', label: '序号' },

  {
    prop: 'itemCode',
    label: '产品编码',
    width: 200,
    'show-overflow-tooltip': true
  },
  {
    prop: 'nameCn',
    label: '产品名称',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'specification',
    label: '规格',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'productType',
    label: '型号',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'minUnit',
    label: '最小单位',
    width: 100
  },
  {
    prop: 'price',
    label: '销售价格(元)',
    width: 200,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(Number(row.price) || 0)
  },
  {
    prop: 'templatePrice',
    label: '模板价格(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(Number(row.templatePrice) || 0)
  },
  {
    prop: 'priceDifference',
    label: '价格差异(元)',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => getFormatterPrice(Number(row.priceDifference) || 0)
  },
  {
    prop: 'registrationNumber',
    label: '注册证号/备案证号',
    'min-width': 180,
    'show-overflow-tooltip': true
  },
  {
    prop: 'manufacturer',
    label: '生产厂家',
    'min-width': 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'category',
    label: '产品大类',
    width: 120,
    'show-overflow-tooltip': true,
    formatter: row => PRODUCT_CATEGORY[row.category]
  },
  {
    prop: 'purchaseNum',
    label: '销售数量',
    minWidth: 200
  },
  {
    prop: 'detailAmount',
    label: '小计金额(元)',
    width: 120,
    'show-overflow-tooltip': true
  },
  {
    prop: 'hspProdCode',
    label: '医疗机构产品编码',
    width: 150
  },
  {
    prop: 'action',
    label: '操作',
    width: 100,
    fixed: 'right'
  }
]
export const commonProductListSearchForm = [
  {
    key: 'companyProdCode',
    title: '产品编码',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'prodNameCn',
    title: '产品名称',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'model',
    title: '型号',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },

  // {
  //   type: 'select',
  //   options: [],
  //   key: 'upEnterpriseId',
  //   title: '供应商', // 1
  //   attr: {
  //     placeholder: '请输入',
  //     filterable: true,
  //     remote: true
  //   } },
  {
    key: 'manufacturer',
    title: '生产厂家',
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  },
  {
    key: 'registNo',
    title: '注册证号', // 1
    type: 'input',
    attr: {
      placeholder: '请输入'
    }
  }
]
